import axios from "axios";
import request from "@/utils/request";
export default {
  // 注册管理员
  regAdmin: value =>
    axios
      .post("/api/admin/reg", {
        params: value
      })
      .then(function(response) {
        return response.data;
      }),
  // 根据 id修改数据
  updateAdmin: AdminId => {
    request
      .put(`/admin/${AdminId[0].id}`, AdminId[1])
      .then(function(response) {
        return response;
      });
  },
  getAdminCondition: AdminId => {
    request
      .get("/admin/adminCondition", { params: AdminId })
      .then(function(response) {
        return response;
      });
  }
};
// 获取平台管理员数据
export function getAdminList(data) {
  return request({
    url: "admin/adminList",
    method: "get",
    params: data
  });
}
// 根据 id 删除数据
export function deletaAdmin(AdminId) {
  return request({
    url: "admin/deleteId",
    method: "delete",
    params: { id: AdminId }
  });
}
// 修改门店状态
export function putShop(data) {
  console.log(data);
  return request({
    url: "shops",
    method: "put",
    params: { params: data }
  });
}
